﻿using System;
using System.Windows.Forms;

using SharedGenomics.Core;
using SharedGenomics.Workbench.Core;

namespace SharedGenomics.Workbench.Views.WindowsForms
{
    public class WindowsFormsCursorManager : ICursorManager
    {
        public void SetBusy(IView view)
        {
            view.ThrowIfNull("view");
            ExceptionHelper.ThrowIf<ArgumentException>(!(view is Control), "Invalid view type (expected System.Windows.Forms.Control)");

            ((Control)view).Cursor = Cursors.WaitCursor;
        }

        public void SetDefault(IView view)
        {
            view.ThrowIfNull("view");
            ExceptionHelper.ThrowIf<ArgumentException>(!(view is Control), "Invalid view type (expected System.Windows.Forms.Control)");

            ((Control)view).Cursor = Cursors.Default;
        }
    }
}
